package com.itheima.consumer.controller;

import com.itheima.consumer.feign.ProviderFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/consumer")
public class ConsumerController {
    @Autowired
    private ProviderFeign providerFeign;
    @GetMapping("/hello")
    public String hello(){
        return providerFeign.hello();
    }

/*    @Autowired
    RestTemplate restTemplate;
    @GetMapping("/hello")
    public String hello(String name) {
        return restTemplate.getForObject("http://consulprovider/p/hello", String.class);
    }*/
}
